package com.laijiale.dto;

import com.laijiale.constant.RE;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * @author laijiale
 * @date 2025年01月08日 23:57
 */

@Schema(name="用户添加DTO")
@Data
public class UserInsertDTO implements Serializable, RE {
    @Schema(description = "登录账号")
    @NotEmpty(message = "登录账号不能为空")
    @Pattern(regexp = USERNAME_RE, message = USERNAME_RE_MSG)
    private String username;
    @Schema(description = "登录密码")
    @NotEmpty(message = "登录密码不能为空")
    @Pattern(regexp = PASSWORD_RE, message = PASSWORD_RE_MSG)
    private String password;
    @Schema(description = "真实姓名")
    @NotEmpty(message = "真实姓名不能为空")
    @Pattern(regexp = REALNAME_RE, message = REALNAME_RE_MSG)
    private String realname;
    @Schema(description = "身份证号")
    @NotEmpty(message = "身份证号不能为空")
    @Pattern(regexp = ID_CARD_RE, message = ID_CARD_RE_MSG)
    private String idcard;
    @Schema(description = "手机号码")
    @NotEmpty(message = "手机号码不能为空")
    @Pattern(regexp = PHONE_RE, message = PHONE_RE_MSG)
    private String phone;
    @Schema(description = "电子邮箱")
    @NotEmpty(message = "电子邮箱不能为空")
    @Pattern(regexp = EMAIL_RE, message = EMAIL_RE_MSG)
    private String email;
}
